package com.huangj.fragments;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.huangj.entity.HomeInfoEntity;
import com.huangj.huangjlibrary.base.BaseFragment;
import com.huangj.pro2_h2pop.JDRoteMapActivity;
import com.huangj.pro2_h2pop.R;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by HuangJ on 2016/10/5.13:01
 */
public class lv2MapFragment extends BaseFragment {

    @BindView(R.id.fl_lv2title)
    TextView tv_title;
    @BindView(R.id.fl_lv2bottom)
    TextView tv_bottom;
    @BindView(R.id.lv2_fliv)
    ImageView iv_fl;
    private HomeInfoEntity.DataBean.SectionsBean.ModelsBean models;

    public static lv2MapFragment getIntance(HomeInfoEntity.DataBean.SectionsBean.ModelsBean models){
        lv2MapFragment lv2MapFragment = new lv2MapFragment();
        Bundle bundle = new Bundle();
        bundle.putSerializable("models",models);
        lv2MapFragment.setArguments(bundle);
        return lv2MapFragment;
    }
    @Override
    public int getContentId() {
        return R.layout.fl_lv2zw;
    }
    @Override
    protected void getDatas(Bundle bundle) {
        models = (HomeInfoEntity.DataBean.SectionsBean.ModelsBean) bundle.getSerializable("models");
        tv_title.setText(models.getTitle());
        tv_bottom.setText(models.getDays_count()+"天");
    }
    @OnClick(R.id.lv2_fliv)
    public void onClick(View view){
        if (models != null) {
            Intent intent = new Intent(getActivity(), JDRoteMapActivity.class);
            intent.putExtra("models",models);
            startActivity(intent);
            getActivity().overridePendingTransition(R.anim.bottom_in,R.anim.bottomout);
        }
    }
}
